home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / MacWindows.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  30.9 KB  |  855 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        MacWindows.p
  3.  
  4.      Contains:    Window Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8.1
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT MacWindows;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __MACWINDOWS__}
  28. {$SETC __MACWINDOWS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC MacWindowsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __ALIASES__}
  38. {$I Aliases.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __APPLEEVENTS__}
  41. {$I AppleEvents.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __COLLECTIONS__}
  44. {$I Collections.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __DRAG__}
  47. {$I Drag.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __EVENTS__}
  50. {$I Events.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __MENUS__}
  53. {$I Menus.p}
  54. {$ENDC}
  55. {$IFC UNDEFINED __MIXEDMODE__}
  56. {$I MixedMode.p}
  57. {$ENDC}
  58. {$IFC UNDEFINED __QDOFFSCREEN__}
  59. {$I QDOffscreen.p}
  60. {$ENDC}
  61. {$IFC UNDEFINED __QUICKDRAW__}
  62. {$I Quickdraw.p}
  63. {$ENDC}
  64. {$IFC UNDEFINED __TEXTCOMMON__}
  65. {$I TextCommon.p}
  66. {$ENDC}
  67.  
  68.  
  69. {$PUSH}
  70. {$ALIGN MAC68K}
  71. {$LibExport+}
  72.  
  73. {——————————————————————————————————————————————————————————————————————————————————————}
  74. { • Window Definition Type                                                                }
  75. {——————————————————————————————————————————————————————————————————————————————————————}
  76.  
  77. CONST
  78.     kWindowDefProcType            = 'WDEF';
  79.  
  80. {——————————————————————————————————————————————————————————————————————————————————————}
  81. { • System 7.5 Window Definition Resource IDs                                            }
  82. {——————————————————————————————————————————————————————————————————————————————————————}
  83.     kStandardWindowDefinition    = 0;                            {  for document windows and dialogs }
  84.     kRoundWindowDefinition        = 1;                            {  old da-style window }
  85.     kFloatingWindowDefinition    = 124;                            {  for floating windows }
  86.  
  87. {——————————————————————————————————————————————————————————————————————————————————————}
  88. { • Variant Codes                                                                        }
  89. {——————————————————————————————————————————————————————————————————————————————————————}
  90.                                                                 {  for use with kStandardWindowDefinition  }
  91.     kDocumentWindowVariantCode    = 0;
  92.     kModalDialogVariantCode        = 1;
  93.     kPlainDialogVariantCode        = 2;
  94.     kShadowDialogVariantCode    = 3;
  95.     kMovableModalDialogVariantCode = 5;
  96.     kAlertVariantCode            = 7;
  97.     kMovableAlertVariantCode    = 9;                            {  for use with kFloatingWindowDefinition  }
  98.     kSideFloaterVariantCode        = 8;
  99.  
  100.  
  101. {——————————————————————————————————————————————————————————————————————————————————————}
  102. { • DefProc IDs                                                                        }
  103. {——————————————————————————————————————————————————————————————————————————————————————}
  104.                                                                 {  classic ids  }
  105.     documentProc                = 0;
  106.     dBoxProc                    = 1;
  107.     plainDBox                    = 2;
  108.     altDBoxProc                    = 3;
  109.     noGrowDocProc                = 4;
  110.     movableDBoxProc                = 5;
  111.     zoomDocProc                    = 8;
  112.     zoomNoGrow                    = 12;
  113.     rDocProc                    = 16;                            {  floating window defproc ids  }
  114.     floatProc                    = 1985;
  115.     floatGrowProc                = 1987;
  116.     floatZoomProc                = 1989;
  117.     floatZoomGrowProc            = 1991;
  118.     floatSideProc                = 1993;
  119.     floatSideGrowProc            = 1995;
  120.     floatSideZoomProc            = 1997;
  121.     floatSideZoomGrowProc        = 1999;
  122.  
  123.                                                                 {  Resource IDs for theme-savvy window defprocs  }
  124.     kWindowDocumentDefProcResID    = 64;
  125.     kWindowDialogDefProcResID    = 65;
  126.     kWindowUtilityDefProcResID    = 66;
  127.     kWindowUtilitySideTitleDefProcResID = 67;
  128.  
  129.                                                                 {  Proc IDs for theme-savvy windows  }
  130.     kWindowDocumentProc            = 1024;
  131.     kWindowGrowDocumentProc        = 1025;
  132.     kWindowVertZoomDocumentProc    = 1026;
  133.     kWindowVertZoomGrowDocumentProc = 1027;
  134.     kWindowHorizZoomDocumentProc = 1028;
  135.     kWindowHorizZoomGrowDocumentProc = 1029;
  136.     kWindowFullZoomDocumentProc    = 1030;
  137.     kWindowFullZoomGrowDocumentProc = 1031;
  138.  
  139.                                                                 {  Proc IDs for theme-savvy dialogs  }
  140.     kWindowPlainDialogProc        = 1040;
  141.     kWindowShadowDialogProc        = 1041;
  142.     kWindowModalDialogProc        = 1042;
  143.     kWindowMovableModalDialogProc = 1043;
  144.     kWindowAlertProc            = 1044;
  145.     kWindowMovableAlertProc        = 1045;
  146.  
  147. { procIDs available in Appearance 1.0.1 or later }
  148.     kWindowMovableModalGrowProc    = 1046;
  149.  
  150.                                                                 {  Proc IDs for top title bar theme-savvy floating windows  }
  151.     kWindowFloatProc            = 1057;
  152.     kWindowFloatGrowProc        = 1059;
  153.     kWindowFloatVertZoomProc    = 1061;
  154.     kWindowFloatVertZoomGrowProc = 1063;
  155.     kWindowFloatHorizZoomProc    = 1065;
  156.     kWindowFloatHorizZoomGrowProc = 1067;
  157.     kWindowFloatFullZoomProc    = 1069;
  158.     kWindowFloatFullZoomGrowProc = 1071;
  159.  
  160.  
  161.                                                                 {  Proc IDs for side title bar theme-savvy floating windows  }
  162.     kWindowFloatSideProc        = 1073;
  163.     kWindowFloatSideGrowProc    = 1075;
  164.     kWindowFloatSideVertZoomProc = 1077;
  165.     kWindowFloatSideVertZoomGrowProc = 1079;
  166.     kWindowFloatSideHorizZoomProc = 1081;
  167.     kWindowFloatSideHorizZoomGrowProc = 1083;
  168.     kWindowFloatSideFullZoomProc = 1085;
  169.     kWindowFloatSideFullZoomGrowProc = 1087;
  170.  
  171. {——————————————————————————————————————————————————————————————————————————————————————}
  172. { • System 7 Window Positioning Constants                                                }
  173. {                                                                                        }
  174. { Passed into StandardAlert and used in ‘WIND’, ‘DLOG’, and ‘ALRT’ templates            }
  175. { StandardAlert uses zero to specify the default position. Other calls use zero to        }
  176. { specify “no position”.  Do not pass these constants to RepositionWindow.  Do not        }
  177. { store these constants in the BasicWindowDescription of a ‘wind’ resource.            }
  178. {——————————————————————————————————————————————————————————————————————————————————————}
  179.  
  180.     kWindowNoPosition            = $0000;
  181.     kWindowDefaultPosition        = $0000;
  182.     kWindowCenterMainScreen        = $280A;
  183.     kWindowAlertPositionMainScreen = $300A;
  184.     kWindowStaggerMainScreen    = $380A;
  185.     kWindowCenterParentWindow    = $A80A;
  186.     kWindowAlertPositionParentWindow = $B00A;
  187.     kWindowStaggerParentWindow    = $B80A;
  188.     kWindowCenterParentWindowScreen = $680A;
  189.     kWindowAlertPositionParentWindowScreen = $700A;
  190.     kWindowStaggerParentWindowScreen = $780A;
  191.  
  192. {——————————————————————————————————————————————————————————————————————————————————————}
  193. { • GetWindowRegion Types                                                                }
  194. {——————————————————————————————————————————————————————————————————————————————————————}
  195.  
  196.                                                                 {  Region values to pass into GetWindowRegion  }
  197.     kWindowTitleBarRgn            = 0;
  198.     kWindowTitleTextRgn            = 1;
  199.     kWindowCloseBoxRgn            = 2;
  200.     kWindowZoomBoxRgn            = 3;
  201.     kWindowDragRgn                = 5;
  202.     kWindowGrowRgn                = 6;
  203.     kWindowCollapseBoxRgn        = 7;
  204.     kWindowStructureRgn            = 32;
  205.     kWindowContentRgn            = 33;
  206.  
  207.  
  208. TYPE
  209.     WindowRegionCode                    = UInt16;
  210. { GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion }
  211.     GetWindowRegionRecPtr = ^GetWindowRegionRec;
  212.     GetWindowRegionRec = RECORD
  213.         winRgn:                    RgnHandle;
  214.         regionCode:                WindowRegionCode;
  215.     END;
  216.  
  217.     GetWindowRegionPtr                    = ^GetWindowRegionRec;
  218.  
  219. {——————————————————————————————————————————————————————————————————————————————————————}
  220. { • Standard Window Kinds                                                                }
  221. {——————————————————————————————————————————————————————————————————————————————————————}
  222.  
  223. CONST
  224.     dialogKind                    = 2;
  225.     userKind                    = 8;
  226.     kDialogWindowKind            = 2;
  227.     kApplicationWindowKind        = 8;
  228.  
  229.  
  230. {——————————————————————————————————————————————————————————————————————————————————————}
  231. { • FindWindow Result Codes                                                            }
  232. {——————————————————————————————————————————————————————————————————————————————————————}
  233.     inDesk                        = 0;
  234.     inNoWindow                    = 0;
  235.     inMenuBar                    = 1;
  236.     inSysWindow                    = 2;
  237.     inContent                    = 3;
  238.     inDrag                        = 4;
  239.     inGrow                        = 5;
  240.     inGoAway                    = 6;
  241.     inZoomIn                    = 7;
  242.     inZoomOut                    = 8;
  243.     inCollapseBox                = 11;
  244.  
  245. {——————————————————————————————————————————————————————————————————————————————————————}
  246. { • Window Definition Hit Test Result Codes                                            }
  247. {——————————————————————————————————————————————————————————————————————————————————————}
  248.     wNoHit                        = 0;
  249.     wInContent                    = 1;
  250.     wInDrag                        = 2;
  251.     wInGrow                        = 3;
  252.     wInGoAway                    = 4;
  253.     wInZoomIn                    = 5;
  254.     wInZoomOut                    = 6;
  255.     wInCollapseBox                = 9;
  256.  
  257. {——————————————————————————————————————————————————————————————————————————————————————}
  258. { • Window Definition Messages                                                            }
  259. {——————————————————————————————————————————————————————————————————————————————————————}
  260.  
  261.     kWindowMsgDraw                = 0;
  262.     kWindowMsgHitTest            = 1;
  263.     kWindowMsgCalculateShape    = 2;
  264.     kWindowMsgInitialize        = 3;
  265.     kWindowMsgCleanUp            = 4;
  266.     kWindowMsgDrawGrowOutline    = 5;
  267.     kWindowMsgDrawGrowBox        = 6;
  268.     kWindowMsgGetFeatures        = 7;
  269.     kWindowMsgGetRegion            = 8;                            {  old names }
  270.     wDraw                        = 0;
  271.     wHit                        = 1;
  272.     wCalcRgns                    = 2;
  273.     wNew                        = 3;
  274.     wDispose                    = 4;
  275.     wGrow                        = 5;
  276.     wDrawGIcon                    = 6;
  277.  
  278.  
  279. {——————————————————————————————————————————————————————————————————————————————————————}
  280. { • Window Feature Bits                                                                }
  281. {——————————————————————————————————————————————————————————————————————————————————————}
  282.     kWindowCanGrow                = $01;
  283.     kWindowCanZoom                = $02;
  284.     kWindowCanCollapse            = $04;
  285.     kWindowIsModal                = $08;
  286.     kWindowCanGetWindowRegion    = $10;
  287.     kWindowIsAlert                = $20;
  288.     kWindowHasTitleBar            = $40;
  289.  
  290.  
  291. {——————————————————————————————————————————————————————————————————————————————————————}
  292. { • Desktop Pattern Resource ID                                                        }
  293. {——————————————————————————————————————————————————————————————————————————————————————}
  294.     deskPatID                    = 16;
  295.  
  296.  
  297.  
  298. {——————————————————————————————————————————————————————————————————————————————————————}
  299. { • Window Color Part Codes                                                            }
  300. {——————————————————————————————————————————————————————————————————————————————————————}
  301.     wContentColor                = 0;
  302.     wFrameColor                    = 1;
  303.     wTextColor                    = 2;
  304.     wHiliteColor                = 3;
  305.     wTitleBarColor                = 4;
  306.  
  307.  
  308. {——————————————————————————————————————————————————————————————————————————————————————}
  309. {    • Region Dragging Constants
  310. /*——————————————————————————————————————————————————————————————————————————————————————}
  311.  
  312.     kMouseUpOutOfSlop            = $80008000;
  313.  
  314.  
  315. {——————————————————————————————————————————————————————————————————————————————————————}
  316. { • Window Color Table                                                                    }
  317. {——————————————————————————————————————————————————————————————————————————————————————}
  318.  
  319. TYPE
  320.     WinCTabPtr = ^WinCTab;
  321.     WinCTab = RECORD
  322.         wCSeed:                    LONGINT;                                {  reserved  }
  323.         wCReserved:                INTEGER;                                {  reserved  }
  324.         ctSize:                    INTEGER;                                {  usually 4 for windows  }
  325.         ctTable:                ARRAY [0..4] OF ColorSpec;
  326.     END;
  327.  
  328.     WCTabPtr                            = ^WinCTab;
  329.     WCTabHandle                            = ^WCTabPtr;
  330. {——————————————————————————————————————————————————————————————————————————————————————}
  331. { • WindowRecord                                                                        }
  332. {——————————————————————————————————————————————————————————————————————————————————————}
  333.     WindowRecordPtr = ^WindowRecord;
  334.     WindowPeek                            = ^WindowRecord;
  335.     WindowRecord = RECORD
  336.         port:                    GrafPort;
  337.         windowKind:                INTEGER;
  338.         visible:                BOOLEAN;
  339.         hilited:                BOOLEAN;
  340.         goAwayFlag:                BOOLEAN;
  341.         spareFlag:                BOOLEAN;
  342.         strucRgn:                RgnHandle;
  343.         contRgn:                RgnHandle;
  344.         updateRgn:                RgnHandle;
  345.         windowDefProc:            Handle;
  346.         dataHandle:                Handle;
  347.         titleHandle:            StringHandle;
  348.         titleWidth:                INTEGER;
  349.         controlList:            Handle;
  350.         nextWindow:                WindowPeek;
  351.         windowPic:                PicHandle;
  352.         refCon:                    LONGINT;
  353.     END;
  354.  
  355. {——————————————————————————————————————————————————————————————————————————————————————}
  356. { • Color WindowRecord                                                                    }
  357. {——————————————————————————————————————————————————————————————————————————————————————}
  358.     CWindowRecordPtr = ^CWindowRecord;
  359.     CWindowPeek                            = ^CWindowRecord;
  360.     CWindowRecord = RECORD
  361.         port:                    CGrafPort;
  362.         windowKind:                INTEGER;
  363.         visible:                BOOLEAN;
  364.         hilited:                BOOLEAN;
  365.         goAwayFlag:                BOOLEAN;
  366.         spareFlag:                BOOLEAN;
  367.         strucRgn:                RgnHandle;
  368.         contRgn:                RgnHandle;
  369.         updateRgn:                RgnHandle;
  370.         windowDefProc:            Handle;
  371.         dataHandle:                Handle;
  372.         titleHandle:            StringHandle;
  373.         titleWidth:                INTEGER;
  374.         controlList:            Handle;
  375.         nextWindow:                CWindowPeek;
  376.         windowPic:                PicHandle;
  377.         refCon:                    LONGINT;
  378.     END;
  379.  
  380. {——————————————————————————————————————————————————————————————————————————————————————}
  381. { • AuxWinHandle                                                                        }
  382. {——————————————————————————————————————————————————————————————————————————————————————}
  383.     AuxWinRecPtr = ^AuxWinRec;
  384.     AuxWinPtr                            = ^AuxWinRec;
  385.     AuxWinHandle                        = ^AuxWinPtr;
  386.     AuxWinRec = RECORD
  387.         awNext:                    AuxWinHandle;                            { handle to next AuxWinRec }
  388.         awOwner:                WindowPtr;                                { ptr to window  }
  389.         awCTable:                CTabHandle;                                { color table for this window }
  390.         reserved:                Handle;
  391.         awFlags:                LONGINT;                                { reserved for expansion }
  392.         awReserved:                CTabHandle;                                { reserved for expansion }
  393.         awRefCon:                LONGINT;                                { user Constant }
  394.     END;
  395.  
  396. {——————————————————————————————————————————————————————————————————————————————————————}
  397. { • Window Class Ordering                                                                }
  398. {                                                                                        }
  399. {    Special cases for the “behind” parameter in window creation calls.                    }
  400. {——————————————————————————————————————————————————————————————————————————————————————}
  401. {$IFC UNDEFINED __cplusplus }
  402.  
  403. CONST
  404.     kFirstWindowOfClass            = -1;
  405.     kLastWindowOfClass            = 0;
  406.  
  407. {$ELSEC}
  408. {$ENDC}
  409.  
  410. {——————————————————————————————————————————————————————————————————————————————————————}
  411. { • Zoom Information Handle                                                             }
  412. {——————————————————————————————————————————————————————————————————————————————————————}
  413.  
  414. TYPE
  415.     WStateDataPtr = ^WStateData;
  416.     WStateData = RECORD
  417.         userState:                Rect;                                    { user zoom state }
  418.         stdState:                Rect;                                    { standard zoom state }
  419.     END;
  420.  
  421.     WStateDataHandle                    = ^WStateDataPtr;
  422. {——————————————————————————————————————————————————————————————————————————————————————}
  423. { • Window Creation & Persistence                                                        }
  424. {——————————————————————————————————————————————————————————————————————————————————————}
  425.  
  426. FUNCTION GetNewCWindow(windowID: INTEGER; wStorage: UNIV Ptr; behind: WindowPtr): WindowPtr;
  427.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  428.     INLINE $AA46;
  429.     {$ENDC}
  430. FUNCTION NewWindow(wStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; theProc: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LONGINT): WindowPtr;
  431.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  432.     INLINE $A913;
  433.     {$ENDC}
  434. FUNCTION GetNewWindow(windowID: INTEGER; wStorage: UNIV Ptr; behind: WindowPtr): WindowPtr;
  435.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  436.     INLINE $A9BD;
  437.     {$ENDC}
  438. FUNCTION NewCWindow(wStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: Str255; visible: BOOLEAN; procID: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LONGINT): WindowPtr;
  439.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  440.     INLINE $AA45;
  441.     {$ENDC}
  442. PROCEDURE DisposeWindow(theWindow: WindowPtr);
  443.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  444.     INLINE $A914;
  445.     {$ENDC}
  446. PROCEDURE CloseWindow(theWindow: WindowPtr);
  447.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  448.     INLINE $A92D;
  449.     {$ENDC}
  450.  
  451.  
  452.  
  453. {——————————————————————————————————————————————————————————————————————————————————————}
  454. { • Background Imaging                                                                    }
  455. {——————————————————————————————————————————————————————————————————————————————————————}
  456. PROCEDURE SetWinColor(theWindow: WindowPtr; newColorTable: WCTabHandle);
  457.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  458.     INLINE $AA41;
  459.     {$ENDC}
  460. PROCEDURE SetDeskCPat(deskPixPat: PixPatHandle);
  461.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  462.     INLINE $AA47;
  463.     {$ENDC}
  464.  
  465.  
  466.  
  467. {——————————————————————————————————————————————————————————————————————————————————————}
  468. { • Low-Level Region & Painting Routines                                                }
  469. {——————————————————————————————————————————————————————————————————————————————————————}
  470. PROCEDURE ClipAbove(window: WindowPtr);
  471.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  472.     INLINE $A90B;
  473.     {$ENDC}
  474. PROCEDURE SaveOld(window: WindowPtr);
  475.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  476.     INLINE $A90E;
  477.     {$ENDC}
  478. PROCEDURE DrawNew(window: WindowPtr; update: BOOLEAN);
  479.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  480.     INLINE $A90F;
  481.     {$ENDC}
  482. PROCEDURE PaintOne(window: WindowPtr; clobberedRgn: RgnHandle);
  483.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  484.     INLINE $A90C;
  485.     {$ENDC}
  486. PROCEDURE PaintBehind(startWindow: WindowPtr; clobberedRgn: RgnHandle);
  487.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  488.     INLINE $A90D;
  489.     {$ENDC}
  490. PROCEDURE CalcVis(window: WindowPtr);
  491.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  492.     INLINE $A909;
  493.     {$ENDC}
  494. PROCEDURE CalcVisBehind(startWindow: WindowPtr; clobberedRgn: RgnHandle);
  495.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  496.     INLINE $A90A;
  497.     {$ENDC}
  498. FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;
  499.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  500.     INLINE $A911;
  501.     {$ENDC}
  502. {——————————————————————————————————————————————————————————————————————————————————————}
  503. { • Window List                                                                        }
  504. {——————————————————————————————————————————————————————————————————————————————————————}
  505. FUNCTION FindWindow(thePoint: Point; VAR theWindow: WindowPtr): INTEGER;
  506.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  507.     INLINE $A92C;
  508.     {$ENDC}
  509. FUNCTION FrontWindow: WindowPtr;
  510.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  511.     INLINE $A924;
  512.     {$ENDC}
  513. PROCEDURE BringToFront(theWindow: WindowPtr);
  514.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  515.     INLINE $A920;
  516.     {$ENDC}
  517. PROCEDURE SendBehind(theWindow: WindowPtr; behindWindow: WindowPtr);
  518.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  519.     INLINE $A921;
  520.     {$ENDC}
  521. PROCEDURE SelectWindow(theWindow: WindowPtr);
  522.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  523.     INLINE $A91F;
  524.     {$ENDC}
  525.  
  526. {——————————————————————————————————————————————————————————————————————————————————————}
  527. { • Misc Low-Level stuff                                                                            }
  528. {——————————————————————————————————————————————————————————————————————————————————————}
  529. PROCEDURE InitWindows;
  530.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  531.     INLINE $A912;
  532.     {$ENDC}
  533. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);
  534.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  535.     INLINE $A910;
  536.     {$ENDC}
  537. PROCEDURE GetCWMgrPort(VAR wMgrCPort: CGrafPtr);
  538.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  539.     INLINE $AA48;
  540.     {$ENDC}
  541.  
  542.  
  543. {——————————————————————————————————————————————————————————————————————————————————————}
  544. { • Various & Sundry Window Accessors                                                            }
  545. {——————————————————————————————————————————————————————————————————————————————————————}
  546. PROCEDURE HiliteWindow(theWindow: WindowPtr; fHilite: BOOLEAN);
  547.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  548.     INLINE $A91C;
  549.     {$ENDC}
  550. FUNCTION GetWindowFeatures(inWindow: WindowPtr; VAR outFeatures: UInt32): OSStatus;
  551.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  552.     INLINE $303C, $0013, $AA74;
  553.     {$ENDC}
  554. FUNCTION GetWindowRegion(inWindow: WindowPtr; inRegionCode: WindowRegionCode; ioWinRgn: RgnHandle): OSStatus;
  555.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  556.     INLINE $303C, $0014, $AA74;
  557.     {$ENDC}
  558. PROCEDURE SetWRefCon(theWindow: WindowPtr; data: LONGINT);
  559.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  560.     INLINE $A918;
  561.     {$ENDC}
  562. FUNCTION GetWRefCon(theWindow: WindowPtr): LONGINT;
  563.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  564.     INLINE $A917;
  565.     {$ENDC}
  566. PROCEDURE SetWindowPic(theWindow: WindowPtr; pic: PicHandle);
  567.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  568.     INLINE $A92E;
  569.     {$ENDC}
  570. FUNCTION GetWindowPic(theWindow: WindowPtr): PicHandle;
  571.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  572.     INLINE $A92F;
  573.     {$ENDC}
  574. FUNCTION GetWVariant(theWindow: WindowPtr): INTEGER;
  575.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  576.     INLINE $A80A;
  577.     {$ENDC}
  578. {——————————————————————————————————————————————————————————————————————————————————————}
  579. { • Update Events                                                                        }
  580. {——————————————————————————————————————————————————————————————————————————————————————}
  581. PROCEDURE InvalRect({CONST}VAR badRect: Rect);
  582.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  583.     INLINE $A928;
  584.     {$ENDC}
  585. PROCEDURE InvalRgn(badRgn: RgnHandle);
  586.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  587.     INLINE $A927;
  588.     {$ENDC}
  589. PROCEDURE ValidRect({CONST}VAR goodRect: Rect);
  590.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  591.     INLINE $A92A;
  592.     {$ENDC}
  593. PROCEDURE ValidRgn(goodRgn: RgnHandle);
  594.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  595.     INLINE $A929;
  596.     {$ENDC}
  597. PROCEDURE BeginUpdate(theWindow: WindowPtr);
  598.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  599.     INLINE $A922;
  600.     {$ENDC}
  601. PROCEDURE EndUpdate(theWindow: WindowPtr);
  602.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  603.     INLINE $A923;
  604.     {$ENDC}
  605.  
  606. {——————————————————————————————————————————————————————————————————————————————————————}
  607. { • DrawGrowIcon                                                                        }
  608. {                                                                                        }
  609. {    With the advent of Appearance, DrawGrowIcon is obsolete.  From Appearance 1.0        }
  610. {    onward, the system WDEF automagically draws the grow icon for growable window        }
  611. {    procIDs.                                                                            }
  612. {——————————————————————————————————————————————————————————————————————————————————————}
  613. PROCEDURE DrawGrowIcon(theWindow: WindowPtr);
  614.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  615.     INLINE $A904;
  616.     {$ENDC}
  617.  
  618. {——————————————————————————————————————————————————————————————————————————————————————}
  619. { • Window Titles & Document Support                                                    }
  620. {——————————————————————————————————————————————————————————————————————————————————————}
  621. PROCEDURE SetWTitle(theWindow: WindowPtr; title: Str255);
  622.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  623.     INLINE $A91A;
  624.     {$ENDC}
  625. PROCEDURE GetWTitle(theWindow: WindowPtr; VAR title: Str255);
  626.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  627.     INLINE $A919;
  628.     {$ENDC}
  629.  
  630.  
  631. {——————————————————————————————————————————————————————————————————————————————————————}
  632. { • Window Positioning                                                                    }
  633. {——————————————————————————————————————————————————————————————————————————————————————}
  634. FUNCTION IsWindowCollapsable(inWindow: WindowPtr): BOOLEAN;
  635.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  636.     INLINE $303C, $000F, $AA74;
  637.     {$ENDC}
  638. FUNCTION IsWindowCollapsed(inWindow: WindowPtr): BOOLEAN;
  639.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  640.     INLINE $303C, $0010, $AA74;
  641.     {$ENDC}
  642. FUNCTION CollapseWindow(inWindow: WindowPtr; inCollapseIt: BOOLEAN): OSStatus;
  643.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  644.     INLINE $303C, $0011, $AA74;
  645.     {$ENDC}
  646. FUNCTION CollapseAllWindows(inCollapseEm: BOOLEAN): OSStatus;
  647.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  648.     INLINE $303C, $0012, $AA74;
  649.     {$ENDC}
  650. PROCEDURE MoveWindow(theWindow: WindowPtr; hGlobal: INTEGER; vGlobal: INTEGER; front: BOOLEAN);
  651.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  652.     INLINE $A91B;
  653.     {$ENDC}
  654. PROCEDURE SizeWindow(theWindow: WindowPtr; w: INTEGER; h: INTEGER; fUpdate: BOOLEAN);
  655.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  656.     INLINE $A91D;
  657.     {$ENDC}
  658.  
  659. PROCEDURE ZoomWindow(theWindow: WindowPtr; partCode: INTEGER; front: BOOLEAN);
  660.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  661.     INLINE $A83A;
  662.     {$ENDC}
  663. FUNCTION GrowWindow(theWindow: WindowPtr; startPt: Point; {CONST}VAR bBox: Rect): LONGINT;
  664.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  665.     INLINE $A92B;
  666.     {$ENDC}
  667. PROCEDURE DragWindow(theWindow: WindowPtr; startPt: Point; {CONST}VAR boundsRect: Rect);
  668.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  669.     INLINE $A925;
  670.     {$ENDC}
  671.  
  672. {——————————————————————————————————————————————————————————————————————————————————————}
  673. { • Window Visibility                                                                    }
  674. {——————————————————————————————————————————————————————————————————————————————————————}
  675.  
  676. PROCEDURE HideWindow(theWindow: WindowPtr);
  677.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  678.     INLINE $A916;
  679.     {$ENDC}
  680. PROCEDURE ShowWindow(theWindow: WindowPtr);
  681.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  682.     INLINE $A915;
  683.     {$ENDC}
  684. PROCEDURE ShowHide(theWindow: WindowPtr; showFlag: BOOLEAN);
  685.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  686.     INLINE $A908;
  687.     {$ENDC}
  688.  
  689. {——————————————————————————————————————————————————————————————————————————————————————}
  690. { • Utilities                                                                            }
  691. {——————————————————————————————————————————————————————————————————————————————————————}
  692. FUNCTION PinRect({CONST}VAR theRect: Rect; thePt: Point): LONGINT;
  693.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  694.     INLINE $A94E;
  695.     {$ENDC}
  696.  
  697. FUNCTION GetGrayRgn: RgnHandle;
  698.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  699.     INLINE $2EB8, $09EE;
  700.     {$ENDC}
  701.  
  702. {——————————————————————————————————————————————————————————————————————————————————————}
  703. { • Window Part Tracking                                                                }
  704. {——————————————————————————————————————————————————————————————————————————————————————}
  705. FUNCTION TrackBox(theWindow: WindowPtr; thePt: Point; partCode: INTEGER): BOOLEAN;
  706.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  707.     INLINE $A83B;
  708.     {$ENDC}
  709. FUNCTION TrackGoAway(theWindow: WindowPtr; thePt: Point): BOOLEAN;
  710.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  711.     INLINE $A91E;
  712.     {$ENDC}
  713.  
  714. {——————————————————————————————————————————————————————————————————————————————————————}
  715. { • Region Dragging                                                                    }
  716. {——————————————————————————————————————————————————————————————————————————————————————}
  717. FUNCTION DragGrayRgn(theRgn: RgnHandle; startPt: Point; {CONST}VAR limitRect: Rect; {CONST}VAR slopRect: Rect; axis: INTEGER; actionProc: DragGrayRgnUPP): LONGINT;
  718.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  719.     INLINE $A905;
  720.     {$ENDC}
  721. FUNCTION DragTheRgn(theRgn: RgnHandle; startPt: Point; {CONST}VAR limitRect: Rect; {CONST}VAR slopRect: Rect; axis: INTEGER; actionProc: DragGrayRgnUPP): LONGINT;
  722.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  723.     INLINE $A926;
  724.     {$ENDC}
  725.  
  726. {——————————————————————————————————————————————————————————————————————————————————————}
  727. {    • GetAuxWin                                                                            }
  728. {                                                                                        }
  729. {    Avoid using GetAuxWin if at all possible                                            }
  730. {——————————————————————————————————————————————————————————————————————————————————————}
  731. FUNCTION GetAuxWin(theWindow: WindowPtr; VAR awHndl: AuxWinHandle): BOOLEAN;
  732.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  733.     INLINE $AA42;
  734.     {$ENDC}
  735.  
  736. {——————————————————————————————————————————————————————————————————————————————————————}
  737. { • MixedMode & ProcPtrs                                                                }
  738. {——————————————————————————————————————————————————————————————————————————————————————}
  739.  
  740. TYPE
  741. {$IFC TYPED_FUNCTION_POINTERS}
  742.     WindowDefProcPtr = FUNCTION(varCode: INTEGER; theWindow: WindowPtr; message: INTEGER; param: LONGINT): LONGINT;
  743. {$ELSEC}
  744.     WindowDefProcPtr = ProcPtr;
  745. {$ENDC}
  746.  
  747. {$IFC TYPED_FUNCTION_POINTERS}
  748.     DeskHookProcPtr = PROCEDURE(mouseClick: BOOLEAN; VAR theEvent: EventRecord);
  749. {$ELSEC}
  750.     DeskHookProcPtr = Register68kProcPtr;
  751. {$ENDC}
  752.  
  753.     WindowDefUPP = UniversalProcPtr;
  754.     DeskHookUPP = UniversalProcPtr;
  755.  
  756. CONST
  757.     uppWindowDefProcInfo = $00003BB0;
  758.     uppDeskHookProcInfo = $00130802;
  759.  
  760. FUNCTION NewWindowDefProc(userRoutine: WindowDefProcPtr): WindowDefUPP;
  761.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  762.     INLINE $2E9F;
  763.     {$ENDC}
  764.  
  765. FUNCTION NewDeskHookProc(userRoutine: DeskHookProcPtr): DeskHookUPP;
  766.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  767.     INLINE $2E9F;
  768.     {$ENDC}
  769.  
  770. FUNCTION CallWindowDefProc(varCode: INTEGER; theWindow: WindowPtr; message: INTEGER; param: LONGINT; userRoutine: WindowDefUPP): LONGINT;
  771.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  772.     INLINE $205F, $4E90;
  773.     {$ENDC}
  774.  
  775. PROCEDURE CallDeskHookProc(mouseClick: BOOLEAN; VAR theEvent: EventRecord; userRoutine: DeskHookUPP);
  776.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  777.     {To be implemented:  Glue to move parameters into registers.}
  778.     {$ENDC}
  779. {——————————————————————————————————————————————————————————————————————————————————————}
  780. { • C Glue                                                                                }
  781. {——————————————————————————————————————————————————————————————————————————————————————}
  782. {——————————————————————————————————————————————————————————————————————————————————————}
  783. { • WindowRecord accessor macros                                                        }
  784. {——————————————————————————————————————————————————————————————————————————————————————}
  785. {
  786.     *****************************************************************************
  787.     *                                                                           *
  788.     * The conditional STRICT_WINDOWS has been removed from this interface file. *
  789.     * The accessor macros to a WindowRecord are no longer necessary.            *
  790.     *                                                                           *
  791.     * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  792.     *                                                                           *
  793.     *****************************************************************************
  794.  
  795.     Details:
  796.     The original purpose of the STRICT_ conditionals and accessor macros was to
  797.     help ease the transition to Copland.  Shared data structures are difficult
  798.     to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  799.     WindowRecord and other data structures, we would begin the migration to the
  800.     discipline wherein system data structures are completely hidden from
  801.     applications.
  802.     
  803.     After many design reviews, we finally concluded that with this sort of
  804.     migration, the system could never tell when an application was no longer
  805.     peeking at a WindowRecord, and thus the data structure might never become
  806.     system owned.  Additionally, there were many other limitations in the
  807.     classic toolbox that were begging to be addressed.  The final decision was
  808.     to leave the traditional toolbox as a compatibility mode.
  809.     
  810.     We also decided to use the Handle and Ptr based types in the function
  811.     declarations.  For example, NewWindow now returns a WindowPtr rather than a
  812.     WindowRef.  The Ref types are still defined in the header files, so all
  813.     existing code will still compile exactly as it did before.  There are
  814.     several reasons why we chose to do this:
  815.     
  816.     - The importance of backwards compatibility makes it unfeasible for us to
  817.     enforce real opaque references in the implementation anytime in the
  818.     foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  819.     ControlRef, etc.) in the documentation and header files would always be a
  820.     fake veneer of opacity.
  821.     
  822.     - There exists a significant base of books and sample code that neophyte
  823.     Macintosh developers use to learn how to program the Macintosh.  These
  824.     books and sample code all use direct data access.  Introducing opaque data
  825.     types at this point would confuse neophyte programmers more than it would
  826.     help them.
  827.     
  828.     - Direct data structure access is used by nearly all Macintosh developers. 
  829.     Changing the interfaces to reflect a false opacity would not provide any
  830.     benefit to these developers.
  831.     
  832.     - Accessor functions are useful in and of themselves as convenience
  833.     functions.
  834.     
  835.     - Note: some accessor names conflict with API's in Win32 and have been renamed
  836.     to have a Mac prefix (QuickTime 3.0).
  837. }
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845. {$ALIGN RESET}
  846. {$POP}
  847.  
  848. {$SETC UsingIncludes := MacWindowsIncludes}
  849.  
  850. {$ENDC} {__MACWINDOWS__}
  851.  
  852. {$IFC NOT UsingIncludes}
  853.  END.
  854. {$ENDC}
  855.